use libc;

use std::ffi::CString;
use std::ffi::CStr;

fn call_func() {
    // let mut cs = CString::new("hello").unwrap();
    let mut path: [i8; 1024] = [0; 1024];
    unsafe {
        let res = libc::getcwd(&mut path[0], 1025);
        println!("result: {:?}", res);
        let s = CStr::from_ptr(res);
        println!("Path is {:?}", s);
    };
}
fn main() {

    call_func();

    println!("Exiting");

    unsafe {
        libc::exit(0);
    };
}
